
sources =
sources += cooperative-condition-test.cpp
sources += cooperative-mutex-test.cpp
sources += fiber-env-test.cpp
objects = $(sources:.cpp=.o) gtest-all.o gtest-main.o
target = test

inc = -I../gtest/include -I../gtest -I../fiber-env

all: $(target)
clean:
	rm -f $(target) $(objects)
check: all
	./$(target)
valgrind: all
	valgrind --tool=memcheck --leak-check=yes --log-file=./valgrind.log ./$(target)

$(target): $(objects)
	g++ -o $@ -g -pthread $^ ../fiber-env/libfiberenv.a

gtest-all.o: ../gtest/src/gtest-all.cc
	g++ -c -o $@ $(inc) -g $^

gtest-main.o: ../gtest/src/gtest_main.cc
	g++ -c -o $@ $(inc) -g $^

.cpp.o:
	g++ -c -o $@ $(inc) -g $^

